/*!
 *  \file       test-fft-varianze.cpp
 *  \brief      Main per testare l'andamento della FFT di un segnale Gaussiano in relazione alla varianza
 *
 * Questo programma testa l'andamento della FFT di un segnale gaussiano in
 * relazione alla varianze del segnale stesso
 *
 *  \author     Davide Scola <S2299453@studenti.unige.it>
 *  \author	Minetti Alberto <S3064777@studenti.unige.it>
 *  \version    1.0
 *
 */

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include <cmath>
#include <vector>
#include "ISignalGenerator.hpp"	
#include "GaussianSignalGenerator.cpp"
#include "InputSignal.cpp"
#include "WrapNumber.cpp"
#include "RealNumber.hpp"
#include "Fft.cpp"


using namespace std;


int
main( void )
{
    vector< Fft< RealNumber > > ffts;
    vector< InputSignal< RealNumber > > inputs;
    const long double variance[ N_VARIANCE ] = { 0.01L,  0.05L, 0.10L, 0.20L };

    for( unsigned long int i = 0; i < N_VARIANCE; ++i )
    {
      GaussianSignalGenerator< RealNumber > generator( RealNumber( 0 ), RealNumber( variance[i] ), INPUT_SIZE );
      inputs.push_back( InputSignal< RealNumber >( INPUT_SIZE, generator ) );
      
      ffts.push_back( Fft< RealNumber >( inputs[i].size() ) );
      ffts[i].compute( inputs[i] );
    }
    
    cout.precision( 12 );
    
    for( unsigned int i = 0; i < INPUT_SIZE; ++i ) {
      cout << i << " ";

      for( unsigned long int j = 0; j < N_VARIANCE; ++j) {
        cout << inputs[j][i] << " ";
      }

      for( unsigned long int j = 0; j < N_VARIANCE; ++j) {
        cout << ffts[j][i].real() << " ";
      }

      cout << endl;
    }

    return 0;
}

